package ve.ejb.entity;

import ve.ejb.metadata.Comparator;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author memozac
 */
@Entity
public class PointerComparator implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long idPointerComparator;

    @ManyToOne
    @JoinColumn(name="idPointer",nullable=false,updatable=true)
    private Pointer pointer;

    @ManyToOne
    @JoinColumn(name="idComparator",nullable=false,updatable=true)
    private Comparator comparator;

    @ManyToOne private Person responsible;

    @Temporal(value = TemporalType.TIMESTAMP) private Date registerDate;

    public Date getRegisterDate() {
        return registerDate;
    }

    public void setRegisterDate(Date registerDate) {
        this.registerDate = registerDate;
    }

    public Person getResponsible() {
        return responsible;
    }

    public void setResponsible(Person responsible) {
        this.responsible = responsible;
    }

    public Comparator getComparator() {
        return comparator;
    }

    public void setComparator(Comparator comparator) {
        this.comparator = comparator;
    }

    public Long getIdPointerComparator() {
        return idPointerComparator;
    }

    public void setIdPointerComparator(Long idPointerComparator) {
        this.idPointerComparator = idPointerComparator;
    }

    public Pointer getPointer() {
        return pointer;
    }

    public void setPointer(Pointer pointer) {
        this.pointer = pointer;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPointerComparator != null ? idPointerComparator.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof PointerComparator)) {
            return false;
        }
        PointerComparator other = (PointerComparator) object;
        if ((this.idPointerComparator == null && other.idPointerComparator != null) || (this.idPointerComparator != null && !this.idPointerComparator.equals(other.idPointerComparator))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ve.ejb.entity.PointerComparator[id=" + idPointerComparator + "]";
    }

}//ends of class